package com.example.qimo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qimo.dao.Role;
import com.example.qimo.entsty.RoleView;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface RoleMapper extends BaseMapper<Role> {
    @Select("select c.*,d.remark from (select a.id,a.role_name,a.remerk as role_remark,b.permit_id\n" +
            "from role a left join auth b on a.id=b.role_id)c left join permission d on c.permit_id=d.id;")
    public List<RoleView> getRoleAuthList();
}
